﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="view-agent-target-amount.aspx.cs" 
Inherits="admin_view_agent_target_amount" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="includes/GridStyleSheet.css" rel="stylesheet" type="text/css" />
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td>
                    <h1>
                        CRM Agents Target Amount
                    </h1>
                </td>
            </tr>
            <tr id="trSearch" runat="server">
                <td>
                    <b>Target Year</b> :
                    <asp:DropDownList ID="ddlTargetYear" runat="server">
                        <asp:ListItem Value="2015">2015</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp; 
                    <b>Agent</b> :
                    <asp:DropDownList ID="ddlRenewal" runat="server">
                        <asp:ListItem Value="0">New Agent</asp:ListItem>
                        <asp:ListItem Value="1">Renewal Agent</asp:ListItem>
                        <asp:ListItem Value="2">Admin</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp; <b>Status</b> :
                    <asp:DropDownList ID="ddlStatus" runat="server">
                        <asp:ListItem Value="1" Selected="True">Active</asp:ListItem>
                        <asp:ListItem Value="0">Deactive</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" />&nbsp;                        
                    &nbsp;<asp:Button ID="btnNewTarget" runat="server" OnClick="btnNewTarget_Click" Text="New Target" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblRecordCount" runat="server"></asp:Label>
                    <div style="display: none">
                        <asp:TextBox ID="txtReportType" runat="server"></asp:TextBox>
                        <asp:TextBox ID="txtReportDate1" runat="server"></asp:TextBox>
                        <asp:TextBox ID="txtReportDate2" runat="server"></asp:TextBox>
                        <asp:TextBox ID="txtReportDate" runat="server"></asp:TextBox>
                        <asp:TextBox runat="server" ReadOnly="true" ID="txtAgentId"></asp:TextBox>
                        <asp:Label ID="lblContent" runat="server"></asp:Label>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                    <div style="width: 100%; overflow: auto; height: auto;">
                        <div id="grdCharges" runat="server" style="width: 125%; height: auto;">
                            <asp:GridView ID="grvAgentTarget" runat="server" AutoGenerateColumns="False" DataKeyNames="AgentId"
                                PageSize="8" CellSpacing="3" CellPadding="3" CssClass="admin_gridstyle" PagerStyle-CssClass="pgr"
                                AllowPaging="true" EmptyDataText="There are no data records to display." GridLines="None"
                                Width="110%" OnPageIndexChanging="grvAgentTarget_PageIndexChanging" OnRowCommand="grvAgentTarget_RowCommand"
                                OnRowDataBound="grvAgentTarget_RowDataBound">
                                <Columns>
                                    <asp:BoundField DataField="AgentId" HeaderText="Agent Id" SortExpression="AgentId" ItemStyle-Width="80px" />
                                    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" ItemStyle-Width="200px" />
                                    <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" ItemStyle-Width="80px" />
                                    <asp:BoundField DataField="TargetType" HeaderText="Type" SortExpression="TargetType" ItemStyle-Width="100px" />
                                    <asp:TemplateField HeaderText="Edit">
                                        <ItemTemplate>
                                            <asp:Button runat="server" ID="btnEdit" Text="Edit" CommandName="MyEdit" CommandArgument='<%#Eval("AgentId")%>'
                                                OnClientClick="javascript:return SubmitEditConfirm();" CssClass="blueB ml10" />
                                            <div style="display: none;">
                                                <asp:Label ID="lblEditId" runat="server" Text='<%# Eval("AgentId").ToString() %>'></asp:Label>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="AgentCode" HeaderText="Agent" SortExpression="AgentCode" ItemStyle-Width="100px" />
                                    <asp:BoundField DataField="Jan" HeaderText="January" SortExpression="Jan" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Feb" HeaderText="February" SortExpression="Feb" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Mar" HeaderText="March" SortExpression="Mar" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Apr" HeaderText="April" SortExpression="Apr" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="May" HeaderText="May" SortExpression="May" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Jun" HeaderText="June" SortExpression="Jun" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Jul" HeaderText="July" SortExpression="Jul" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Aug" HeaderText="August" SortExpression="Aug" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Sep" HeaderText="September" SortExpression="Sep" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Oct" HeaderText="October" SortExpression="Oct" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Nov" HeaderText="November" SortExpression="Nov" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                    <asp:BoundField DataField="Dec" HeaderText="December" SortExpression="Dec" ItemStyle-Width="100px" DataFormatString="฿ {0:#,000}" />
                                </Columns>
                                <FooterStyle />
                                <PagerStyle />
                                <SelectedRowStyle />
                                <HeaderStyle CssClass="admin_gridheader" />
                                <EditRowStyle />
                                <AlternatingRowStyle CssClass="admin_gridodd" />
                                <RowStyle CssClass="admin_grideven" />
                            </asp:GridView>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
       
        function SubmitEditConfirm() {
            var _retVal = false;
            _retVal = confirm('Are you Sure to GO EDIT this Agent Target?');
            return _retVal;
        }        

    </script>

</asp:Content>

